<?php

namespace app\admin\validate;

use app\common\Validate;

class AdminRoleValidate extends Validate
{
    /**
     * 验证规则
     */
    protected $rule = [
        "name" => ["require", "length" => '2,12'],
        "auth" => ["require"]
    ];
    /**
     * 提示消息
     */
    protected $message = [
        "name.require" => "不可为空",
        "name.length" => "长度必须2~12个字符",
        "auth.require" => "不可为空"
    ];
    /**
     * 验证场景
     */
    protected $scene = [
        'add'  => ["name", "auth"],
        'edit' => ["name", "auth"],
    ];
}
